home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MATH / MATH1 / RANDOM.LIB < prev    next >
Text File  |  1985-04-03  |  384b  |  20 lines

  1. function random(dummy: integer): real;    { --> 29}
  2. { random number 0-1 }
  3.         { DEFINE SEED=4.0 AS GLOBAL !!!!!!!! }
  4. { adapted from HP-35 applications programs }
  5.  
  6. const
  7.  pi    = 3.14159;
  8.  
  9. var
  10.  x    : real;
  11.  i    : integer;
  12.  
  13. begin    { RANDOM }
  14.  x:=seed+pi;
  15.  x:=exp(5.0*ln(x));
  16.  seed:=x-trunc(x);
  17.  random:=seed
  18. end;        { RANDOM }
  19.  
  20.